<form action="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'save_theme_articles'));?>" method="post">
<?php
    if ($this->pages) 
    {
?>
<div class="pagination top"><?=$this->pages;?></div>
<?
    }

$numRows = sizeof($this->entries);
if ($numRows) {
?>
<table width="100%" cellspacing="0" cellpadding="0" class="edit_block">
<?
    while (list(, $entry) = each($this->entries)) {
        ?>
	  <tr>
<?php 
		if ($this->mainThemeEntry)
		{
?>
	  	<td class="first" width="1"><input type="checkbox" name="theme_id[]" value="<?=$entry->GetId();?>"></td>
<?php 
		}
?>	  	
	  	<td<?=(!$this->mainThemeEntry ? ' class="first"' : '');?> width="10%"><b><?=$entry->GetPublishDate();?></b></td>
		<td class="title"><?=$entry->GetTitle();?> <a
			href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'out_comments', 'blog' => $this->blog->GetId(), 'id' => $entry->GetId()));?>"
			title="комментарии"><b>(<?=$entry->GetCommentsNum();?>)</b></a>
			<div class="tags-block"><?=$entry->GetTags();?></div>
		</td>
		<td width="1"><a
			href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'out_articles', 'blog' => $this->blog->GetId(), 'main_theme_id' => $entry->GetId()));?>"
			title="режим выбора статей по теме"><img
			src="<?=_ROOT_URL;?>files/images/admin/icons/buildings_16x16.png" alt="edit"
			title="" width="16" height="16"></a></td>		
		<td width="1"><a
			href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'add_article', 'blog' => $this->blog->GetId(), 'id' => $entry->GetId()));?>"
			title="редактировать"><img
			src="<?=_ROOT_URL;?>files/images/admin/edit_edit.gif" alt="edit"
			title="" width="30" height="11"></a></td>
		<td width="1" class="last"><a
			href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'del_article', 'blog' => $this->blog->GetId(), 'id' => $entry->GetId()));?>"
			title="Удалить статью?" class="del"><img
			src="<?=_ROOT_URL;?>files/images/admin/edit_close.gif" alt="close"
			title="" width="9" height="11"></a></td>
	</tr>
<?
    }
    ?>
 </table>
<?
} else {
    ?>
	нет статей
<?
}

	if ($this->pages) 
	{
?>
<div class="pagination"><?=$this->pages;?></div>
<?
    }
?>  
<br> 
<?php 
		if ($this->mainThemeEntry)
		{
?> 
<table>
	<tr>
		<td class="r"><input type="submit" class="bt" value="Добавить" /></td>
		<td class="l"><input type="button" value="Вернуться" class="bt"
			onClick="window.location.href='<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'out_articles', 'blog' => $this->blog->GetId(), 'main_theme_id' => 0));?>';" /></td>
	</tr>
</table>
<input type="hidden" name="blog" value="<?=$this->blog->GetId();?>">
<input type="hidden" name="main_theme_id" value="<?=$this->mainThemeEntry->GetId();?>">
<?php 
		}
		else
		{
?>
<div class="bt_area"><input type="button" class="bt" value="Добавить статью"
	onclick="window.location.href='<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'add_article', 'blog' => $this->blog->GetId()));?>';" />
</div>
<?php 
		}
?>
</form>